import 'package:flutter/material.dart';
import 'package:flutterdemo/share/share_util.dart';

void main() {
  runApp(MaterialApp(
    home: HomePage(),
  ));
}

class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("share"),
      ),
      body: Container(
        child: Column(
          children: <Widget>[
            RaisedButton(
              child: Text("share 分享文本"),
              onPressed: _shareText,
            )
          ],
        ),
      ),
    );
  }

  void _shareText() {
    ShareUtil.shareText("aaa");
  }
}
